import java.awt.Image;
import java.util.ArrayList;
import java.util.Random;

public class FlowerClip {

	private ArrayList<Image> my_images = new ArrayList<Image>();
	private String my_name;
	private double my_price;
	private String my_description;

	public FlowerClip() {
		Random r = new Random();
		my_name = "Unknown"+r.nextInt(600);
		my_price = 0;
		my_images = new ArrayList<Image>();
		my_description = "";
	}
	public FlowerClip(String name, double price, String description) {
		my_name = name;
		my_price = price;
		my_images = new ArrayList<Image>();
		my_description = description;
	}
	
	public void setName(String name){
		my_name = name;
	}
	public void setPrice(int price) {
		my_price = price;
	}
	
	public void deleteImage(Image i){
		my_images.remove(i);
	}
	public void addImage(Image i) {
		my_images.add(i);
	}

	public void setDescription(String description) {
		my_description = description;
	}

	public void addToDescription(String description) {
		my_description.concat(description);
	}

	public double getPrice() {
		return my_price;
	}
	
	public String getName(){
		return my_name;
	}
	public String getDescription() {
		return my_description;
	}
	
	@Override 
	public boolean equals(Object o){
		if(o instanceof FlowerClip){
			FlowerClip f = (FlowerClip)o;
			if(f.getName().equals(my_name)){
				return true;
			}else{
				return false;
			}
		}else{
			return false;
		}
	}
	@Override
	public String toString(){
		return "("+"Clip Name: "+my_name+" Price: $"+this.my_price+" Description: "+this.my_description+')';
	}
	public ArrayList<Image> getImages() {
		ArrayList<Image> copy = new ArrayList<Image>();
		for (Image i : my_images) {
			copy.add(i);
		}
		return copy;
	}
}
